import request from '@/utils/request'

// 查询二手物品订单列表
export function listOrder(query) {
  console.log(query)
  return request({
    // url: '/system/order/list',
    url: '/system/goodsOrder/list',
    method: 'get',
    params: query
  })
}

// 查询二手物品订单详细
// export function getOrder(goodsOrderId) {
//   return request({
//     url: '/system/order/' + goodsOrderId,
//     method: 'get'
//   })
// }

export function getOrder(goodsOrderId) {
  return request({
    url: '/system/goodsOrder/' + goodsOrderId,
    method: 'get'
  })
}

// 新增二手物品订单
export function addOrder(data) {
  return request({
    url: '/system/order',
    method: 'post',
    data: data
  })
}

// 修改二手物品订单
export function updateOrder(data) {
  return request({
    url: '/system/order',
    method: 'put',
    data: data
  })
}

// 删除二手物品订单
export function delOrder(goodsOrderId) {
  return request({
    url: '/system/order/' + goodsOrderId,
    method: 'delete'
  })
}

// 导出二手物品订单
export function exportOrder(query) {
  return request({
    url: '/system/order/export',
    method: 'get',
    params: query
  })
}
